home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows News 2006 October
/
wn148cd2.iso
/
Windows
/
Travailler
/
QuickZip
/
quickzip_460013.exe
/
{app}
/
Scripts
/
BackupLatestFile.akp
next >
Wrap
Text File
|
2005-05-26
|
693b
|
25 lines
const dir = 'c:\temp\';
mask = '*.*';
var i : integer;
fs : TStrings;
most_recent_file_name : string;
most_recent_file_datetime : Tdatetime;
begin
fs := pollfilelist(dir+mask,false);
most_recent_file_name := '';
most_recent_file_datetime := 0;
for i := 0 to fs.count -1 do
if GetFileDateTime(fs.strings[i]) > most_recent_file_datetime then
begin
most_recent_file_datetime := GetFileDateTime(fs.strings[i]);
most_recent_file_name := fs.strings[i];
end;
if most_recent_file_name <> '' then
begin
Open(changefileext(most_recent_file_name,'.zip'));
Add(most_recent_file_name)
DoAdd;
end;
end.